<?php
//ref: http://devzone.zend.com/article/3450 decorators etc.

	class Default_Form_Backend_City extends Default_Form_Common
	{
	    public function init()
	    {
			parent::init();
	    }

		public function add()
	    {

			$labelEn = $this->createElement('text', 'city_label_en');
			$labelEn->setLabel('label-english')
	               	->setRequired(true)
	               	->addValidator('stringLength', false, array(3, 120))
	               	->addFilter('StripTags')
	               	//->addFilter('StringTrim')
	               	;

			$labelTr = $this->createElement('text', 'city_label_tr');
			$labelTr->setLabel('label-turkish')
	               	->setRequired(true)
	               	->addValidator('stringLength', false, array(3, 120))
	               	->addFilter('StripTags')
	               	//->addFilter('StringTrim')
	               	;

			$labelOrg = $this->createElement('text', 'city_label_org');
			$labelOrg->setLabel('label-original')
	               	->setRequired(true)
	               	->addValidator('stringLength', false, array(3, 120))
	               	->addFilter('StripTags')
	               	//->addFilter('StringTrim')
	               	;

	        $model = new Default_Model_DbTable_Country();
	        $countries = $model->getCountriesAsPairs();
			$country = new Zend_Form_Element_Select('country_id');
			$country->setLabel('country')
			         ->setRequired(true)
			         ->addMultiOption('', 'select-label')
			         ->addMultiOptions($countries)
			         ;


			$this->addElement($labelTr)
				 ->addElement($labelEn)
			     ->addElement($labelOrg)
			     ->addElement($country)
			     ;



	    }

		public function edit()
	    {
	    	$this->add();

			$editId = $this->createElement('hidden', 'city_id');

			$this->addElement($editId);


	    }

	}
